texture Tex1 : register(ps, t[0]);
texture Tex2 : register(ps, t[2]);
texture Tex3 : register(ps, t[4]);
texture Tex1Bump : register(ps, t[1]);
texture Tex2Bump : register(ps, t[3]);
texture Tex3Bump : register(ps, t[5]);

texture TexDither : register(ps, t[6]);
texture TexShadowMap : register(ps, t[7]);

sampler2D DiffuseTex1 : register(ps, s[0]) = sampler_state { Texture = (Tex1); ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = ANISOTROPIC; MINFILTER = ANISOTROPIC; MIPFILTER = ANISOTROPIC; };
sampler2D BumpTex1 : register(ps, s[1]) = sampler_state { Texture = (Tex1Bump); ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = LINEAR; };
sampler2D DiffuseTex2 : register(ps, s[2]) = sampler_state { Texture = (Tex2); ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = ANISOTROPIC; MINFILTER = ANISOTROPIC; MIPFILTER = ANISOTROPIC; };
sampler2D BumpTex2 : register(ps, s[3]) = sampler_state { Texture = (Tex2Bump); ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = LINEAR; };
sampler2D DiffuseTex3 : register(ps, s[4]) = sampler_state { Texture = (Tex3); ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = ANISOTROPIC; MINFILTER = ANISOTROPIC; MIPFILTER = ANISOTROPIC; };
sampler2D BumpTex3 : register(ps, s[5]) = sampler_state { Texture = (Tex3Bump); ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = LINEAR; };

sampler2D ShadowMap : register(ps, s[7]) = sampler_state { Texture = (TexShadowMap); ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = LINEAR; };

sampler2D DitherTex : register(ps, s[15]) = sampler_state { Texture = (TexDither); ADDRESSU = WRAP; ADDRESSV = WRAP; ADDRESSW = WRAP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = LINEAR; };

bool DitherFlag : register(ps, b[4]) = false;
bool ShadowsFlag : register(ps, b[1]) = true;

float4 AmbNDiff: register(ps, c[23]) = float4(1.5, 0.002, 1.25, 0.0);
float3 DitherClipParams: register(ps, c[21]) = float3(-0.001, 1.000, 5.656);
float4 DitherTexParams: register(ps, c[20]) = float4(0.016, 0.016, 0.008, 0.008);
float4 Exposure: register(ps, c[24]) = float4(0.022, 0.98, -0.150, 0.000);
float3 FogColor: register(ps, c[29]) = float3(0.405, 0.89, 0.720);
float3 LightVec: register(ps, c[14]) = float3(-0.784, 0.5588, -0.196);
float4 SelCascade: register(ps, c[35]) = float4(0.007, -0.013, 0.5, 1.0);
float4x3 ShadowMats[4]: register(ps, c[36]);
//=
//{
//	float4(0.002,-0.001,-0.000,0.289),
//	float4(-0.001,-0.002,-0.002,0.487),
//	float4(0.000,-0.000,-0.000,0.989)};
float3x3 ShadowNormalMat: register(ps, c[17]);
float4 ShadowNormalOffset: register(ps, c[22]) = float4(0.318, 1.260, 5.027, 27.862);
float3 SunColor: register(ps, c[15]) = float3(3.61, 3.24, 2.560);

//
//
//VertexShader VS_Main = asm
//{
//	//
//	// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//	//
//	// Parameters:
//	//
//	//   float4 AmbLevel;
//	//   float3 CameraPos;
//	//   float4 RangeFog;
//	//   float4x4 ShadowMtx;
//	//   float4 TerrainAmbient;
//	//   float3x2 TexMat1;
//	//   float3x2 TexMat2;
//	//   float4 TexUVMod1;
//	//   float4 TexUVMod2;
//	//   float4 WorldOffset;
//	//   float4x3 WorldViewMtx;
//	//   float4x4 WorldViewProjMtx;
//	//
//	//
//	// Registers:
//	//
//	//   Name             Reg   Size
//	//   ---------------- ----- ----
//	//   WorldViewMtx     c9       3
//	//   WorldViewProjMtx c20      4
//	//   ShadowMtx        c24      3
//	//   AmbLevel         c30      1
//	//   RangeFog         c31      1
//	//   CameraPos        c32      1
//	//   WorldOffset      c33      1
//	//   TexMat1          c34      2
//	//   TexMat2          c36      2
//	//   TexUVMod1        c38      1
//	//   TexUVMod2        c39      1
//	//   TerrainAmbient   c48      1
//	//
//
//	vs_3_0
//		
//		
//		
//		
//		
//		
//		
//		
//		
//
//		// approximately 36 instruction slots used
//};
//
////--------------------------------------------------------------//
//// Pixel Shader
////--------------------------------------------------------------//
//PixelShader PS_Main = asm
//{
//	//
//	// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//	//
//	// Parameters:
//	//
//	//   sampler2D DiffuseTex1;
//	//   sampler2D DiffuseTex2;
//	//   sampler2D DiffuseTex3;
//	//   float3 DitherClipParams;
//	//   bool DitherFlag;
//	//   sampler2D DitherTex;
//	//   float4 DitherTexParams;
//	//   float4 Exposure;
//	//   float3 FogColor;
//	//   float3 LightVec;
//	//   float4 SelCascade;
//	//   sampler2D ShadowMap;
//	//   float4x3 ShadowMats[4];
//	//   float3x3 ShadowNormalMat;
//	//   float4 ShadowNormalOffset;
//	//   bool ShadowsFlag;
//	//   float3 SunColor;
//	//
//	//
//	// Registers:
//	//
//	//   Name               Reg   Size
//	//   ------------------ ----- ----
//	//   ShadowsFlag        b1       1
//	//   DitherFlag         b4       1
//	//   LightVec           c14      1
//	//   SunColor           c15      1
//	//   ShadowNormalMat    c17      3
//	//   DitherTexParams    c20      1
//	//   DitherClipParams   c21      1
//	//   ShadowNormalOffset c22      1
//	//   Exposure           c23      1
//	//   FogColor           c29      1
//	//   SelCascade         c35      1
//	//   ShadowMats         c36     12
//	//   DiffuseTex1        s0       1
//	//   DiffuseTex2        s2       1
//	//   DiffuseTex3        s4       1
//	//   ShadowMap          s7       1
//	//   DitherTex          s15      1
//	//
//
//	ps_3_0
//		def c0, 8, -3.5, 1, 0
//		def c1, 0.308600008, 0.609399974, 0.0820000023, 3
//		def c2, 1, 2, 3, 4
//		def c3, 1, 0, -1, -2
//		def c4, 0.800000012, 0.5, 0, 0
//		dcl_color v0.xyw
//		dcl_texcoord8 v1
//		dcl_texcoord v2.xyz
//		dcl_texcoord1 v3
//		dcl_texcoord2 v4
//		dcl_texcoord4 v5.xy
//		dcl_texcoord7 v6.xyz
//		dcl vPos.xy
//		dcl_2d s0
//		dcl_2d s2
//		dcl_2d s4
//		dcl_2d s7
//		dcl_2d s15
//		nrm r0.xyz, v2
//		dp3_sat r0.w, r0, c14
//		add r1.x, -r0.w, c0.z
//		mul r1.y, r1.x, r1.x
//		mad r1.x, r1.x, -r1.y, c0.z
//		dp2add_pp r0.w, r1.x, r0.w, c0.w
//		dp3 r1.x, v3, v3
//		rsq r1.x, r1.x
//		if b4
//			rcp r1.y, r1.x
//			mad r1.zw, vPos.xyxy, c20.xyxy, c20
//			texld r2, r1.zwzw, s15
//			mul r1.z, r2.w, c21.y
//			mad r1.y, r1.y, c21.x, r1.z
//			add r2, r1.y, c21.z
//			texkill r2
//			endif
//			mul_pp r1.xyz, r1.x, v3
//			dp3_pp r1.x, r0, r1
//			add_sat_pp r1.x, -r1.x, c0.z
//			mul r1.x, r1.x, r1.x
//			mad r1.x, r1.x, c4.x, c4.y
//			mul_pp r0.w, r0.w, r1.x
//			mad_sat r1.xyz, v0.xyww, c0.x, c0.y
//			if b1
//				mad r1.w, v6.z, c35.x, c35.y
//				log r1.w, r1.w
//				mad r1.w, r1.w, c35.z, c35.w
//				max r2.x, r1.w, c0.w
//				min r1.w, r2.x, c1.w
//				frc r2.x, r1.w
//				add r2.x, r1.w, -r2.x
//				add r3, r1.w, c3
//				add r4, -r1.w, c2
//				min r5, r3, r4
//				max r3, r5, c0.w
//				dp4 r1.w, r3, c22
//				dp3 r3.x, r0, c17
//				dp3 r3.y, r0, c18
//				dp3 r3.z, r0, c19
//				mad r3.xyz, r3, r1.w, v6
//				add r0.x, r2.x, -c2.y
//				mov_pp r3.w, c0.z
//				mov r4, c38
//				cmp r4, -r2_abs.x, r4, c41
//				mov r5, c44
//				cmp r5, -r0.x, r5, c47
//				cmp r4, r0.x, r5, r4
//				dp4 r4.z, r3, r4
//				mov r5, c36
//				cmp r5, -r2_abs.x, r5, c39
//				mov r6, c42
//				cmp r6, -r0.x, r6, c45
//				cmp r5, r0.x, r6, r5
//				dp4 r4.x, r3, r5
//				mov r5, c37
//				cmp r2, -r2_abs.x, r5, c40
//				mov r5, c43
//				cmp r5, -r0.x, r5, c46
//				cmp r2, r0.x, r5, r2
//				dp4 r4.y, r3, r2
//				mov_pp r4.w, c0.z
//				texldp r2, r4, s7
//				mov r2.w, r2.x
//			else
//			add r2.w, -r1.z, c0.z
//			endif
//			texld r3, v4, s0
//			dp3 r0.x, r3, c1
//			lrp r4.xyz, c23.w, r0.x, r3
//			mov r4.w, r3.w
//			texld r3, v4.zwzw, s2
//			dp3 r0.x, r3, c1
//			lrp r5.xyz, c23.w, r0.x, r3
//			mov r5.w, r3.w
//			lrp r3, r1.x, r5, r4
//			texld r4, v5, s4
//			dp3 r0.x, r4, c1
//			lrp r5.xyz, c23.w, r0.x, r4
//			mul r0.x, r1.y, r4.w
//			mov r5.w, r4.w
//			lrp r1, r0.x, r5, r3
//			mul_pp r2.xyz, r2.w, c15
//			mad_pp r0, r0.w, r2, v1
//			mad r0.xyz, r1, r0, -c29
//			mad_pp oC0.xyz, v3.w, r0, c29
//			mul_pp r0.x, r0.w, r1.w
//			mov_pp oC0.w, r0.x
//
//			// approximately 95 instruction slots used (5 texture, 90 arithmetic)
//};

//--------------------------------------------------------------//
// Technique Section for Effect Workspace.Effect Group 2.Textured
//--------------------------------------------------------------//
technique Textured
{
	pass Pass_0
	{
		Texture[0] = < Tex1 >;
		Texture[2] = < Tex2 >;
		Texture[4] = < Tex3 >;
		Texture[1] = < Tex1Bump >;
		Texture[3] = < Tex2Bump >;
		Texture[5] = < Tex3Bump >;
		Texture[6] = < TexDither >;
		Texture[7] = < TexShadowMap >;

		Sampler[0] = < DiffuseTex1 >;
		Sampler[1] = < BumpTex1 >;
		Sampler[2] = < DiffuseTex2 >;
		Sampler[3] = < BumpTex2 >;
		Sampler[4] = < DiffuseTex3 >;
		Sampler[5] = < BumpTex3 >;
		Sampler[7] = < ShadowMap >;

		//PixelShaderBool[1] = <ShadowsFlag>;
		//PixelShaderBool[4] = <DitherFlag>;

		PixelShaderConstant[14] = < LightVec >;
		PixelShaderConstant[15] = < SunColor >;
		PixelShaderConstant[17] = < ShadowNormalMat >;
		PixelShaderConstant[20] = < DitherTexParams >;
		PixelShaderConstant[21] = < DitherClipParams >;
		PixelShaderConstant[22] = < ShadowNormalOffset >;
		PixelShaderConstant[23] = < AmbNDiff >;
		PixelShaderConstant[24] = < Exposure >;
		PixelShaderConstant[29] = < FogColor >;
		PixelShaderConstant[35] = < SelCascade >;
		PixelShaderConstant[36] = < ShadowMats >;

		VertexShaderConstant[9] = < WorldViewMtx >;
		VertexShaderConstant[20] = < WorldViewProjMtx >;
		VertexShaderConstant[24] = < ShadowMtx >;
		VertexShaderConstant[30] = < AmbLevel >;
		VertexShaderConstant[31] = < RangeFog >;
		VertexShaderConstant[32] = < CameraPos >;
		VertexShaderConstant[33] = < WorldOffset >;
		VertexShaderConstant[34] = < TexMat1 >;
		VertexShaderConstant[36] = < TexMat2 >;
		VertexShaderConstant[38] = < TexUVMod1 >;
		VertexShaderConstant[39] = < TexUVMod2 >;
		VertexShaderConstant[48] = < TerrainAmbient >;

		//FILLMODE = SOLID;
		//CULLMODE = NONE;
		ALPHABLENDENABLE = FALSE;
		//CLIPPING = FALSE;

		VertexShader = (VS_Main);
		PixelShader = (PS_Main);
	}
}